package IT.shi.OOP;

/**
 * @author げっしょく
 * @date 2021/7/8
 */
class Phone {
    String brand;
    int price;
    private String color;

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        if(color.equals("yellow") || color.equals("red") || color.equals("blue")){
            this.color = color;
        }else{
            System.out.println("该手机没有这款颜色");
        }

    }

    public void call(String name){
        System.out.println("正在使用价格为"+price+"元"+color+"的"+brand+"手机发短信");
    }
    public void sendMessage(){
        System.out.println("正在使用价格为"+price+"元"+color+"的"+brand+"手机发短信");
    }

    public Phone() {
    }

    public Phone(String brand, int price, String color) {
        this.brand = brand;
        this.price = price;
        this.color = color;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

}


/*
    public Phone(String name, int price) {
        this.name = name;
        this.price = price;
    }

    public void pin(String name){
        System.out.print("我是"+(name)+",我喜欢用"+(this.name)+",因为它");
    }
    public void call(String name){
        System.out.println("可以给"+name+"打电话");
    }
    public void sendMessage(String name){
        System.out.println("可以给我的"+name+"发短信");
    }*/